﻿using System;
using System.Text;

namespace AlgoTester
{
    class Certificate
    {
        // Data Members
        private int quantity;
        private Stock stock;

        // Constructor
        public Certificate(int quantity, Stock stock)
        {
            this.quantity = quantity;
            this.stock = stock;
        }

        public string getTicker()
        {
            return stock.getTicker();
        }

        public int getQuantity()
        {
            return quantity;
        }

        public void gainQuantity(int gain)
        {
            quantity += gain;
        }

        public void loseQuantity(int loss)
        {
            quantity -= loss;
        }

        public double getPrice()
        {
            return stock.getCurrentPrice();
        }

        public double markToMarket()
        {
            return quantity * stock.getCurrentPrice();
        }

    }
}
